#ifndef __MACROS__H__
#define __MACROS__H__

#ifdef __cplusplus
extern "C" 
{
#endif

#include <cstl/cvector.h>
#include <tcCommon\tc_common.h>

#define MAX_LISTEN 10

#define SPLIT "|||"

#define ASK_REGISTER	1000
#define ASK_LOGIN		1001
#define ASK_LOGOUT		1002
#define ASK_ALL_USER	1003
#define ASK_INVITE		1004
#define ASK_DATA		1005
#define ASK_EXIT_GAME	1006

#define RES_REGISTER	10010
#define RES_LOGIN		10011
#define RES_LOGOUT		10012
#define RES_ALL_USER	10013
#define RES_INVITE		10014
#define RES_DATA		10015

#define LOGIN_SUCCESS	"10011|||1"
#define LOGIN_FAIL		"10011|||0"
#define START_GAME		"10014|||1"

typedef struct {
	int port;
	int buffer_len;
	void (*SockProc)(char *content, int len);
}ServerOpt;

typedef struct {
	int remote_port;
	char local_port[10];
	char user_name[20];
	char server_name[20];
	BOOL pending;
	BOOL runonce;
	int buffer_len;
	int data_len;
	char * buffer;
	void (*SocketProc)(char *content, int len);
}ClientOpt;

typedef struct {
	char name[20];
	char server_name[16];
	int server_port;
	// opposite's info
	BOOL is_conn;
	SOCKET socket;
	char conn_name[20];
	char conn_server_name[16];
	int conn_server_port;
}User;



#ifdef __cplusplus
}
#endif

#endif